<?php defined('SYSPATH') or die('No direct script access.');
//header('Refresh: 15');
class Controller_TwitterQuery extends Controller_DefaultTemplate {
	
	public function action_index() {
		
		$keywords = array();
		$num_result = 50;
		$tweets = array();
		if (isset($_GET['keywords']))
			$keywords 					= explode(' ', $_GET['keywords']);
			
		$view 						= 	new View('twitterquery');
		$model_message 				= 	new Model_Message;
		$tweets						= 	$model_message->getTwitterQuery($keywords, $num_result);
		$scripts					=	array();
		
		
		
		$this->template->title 		= 	'TwitterQuery';
		$this->template->content 	=	$view;
		$this->template->pageTitle	=	'TwitterQuery';
		$this->template->scripts	= 	array_merge($this->template->scripts, $scripts);
		
		$view->bind("rst", $tweets);
		$view->bind("", $twitter_query);
		
	}
	
}